#include <cstdlib>
#include <string>
#include <iostream>
#include <hash_map>
#include <map>
using namespace std;


class Solution {
public:
	int singleNumber(int A[], int n) {
		map<int, int> m;
		for (int i = 0; i < n; ++i){
			++m[A[i]];
		}
		for (auto p : m){
			if (p.second == 1)
				return p.first;
		}
	}
};

int main(int argc, char** argv){
	int A[]{1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 5};
	cout << Solution().singleNumber(A, 13) << endl;
	return 0;
}